import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '业务ID',
    align: "center",
    dataIndex: 'businessKey'
  },
  {
    title: '流程实例ID',
    align: "center",
    dataIndex: 'processInstanceId'
  },
  {
    title: '任务ID',
    align: "center",
    dataIndex: 'taskId'
  },
  {
    title: '任务名称',
    align: "center",
    dataIndex: 'taskName'
  },
  {
    title: '审批结果',
    align: "center",
    dataIndex: 'approveResult'
  },
  {
    title: '审批人',
    align: "center",
    dataIndex: 'approver'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '业务ID',
    field: 'businessKey',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入业务ID!'},
             ];
    },
  },
  {
    label: '流程实例ID',
    field: 'processInstanceId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入流程实例ID!'},
             ];
    },
  },
  {
    label: '任务ID',
    field: 'taskId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入任务ID!'},
             ];
    },
  },
  {
    label: '任务名称',
    field: 'taskName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入任务名称!'},
             ];
    },
  },
  {
    label: '审批结果',
    field: 'approveResult',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入审批结果!'},
             ];
    },
  },
  {
    label: '审批人',
    field: 'approver',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入审批人!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  businessKey: {title: '业务ID',order: 0,view: 'text', type: 'string',},
  processInstanceId: {title: '流程实例ID',order: 1,view: 'text', type: 'string',},
  taskId: {title: '任务ID',order: 2,view: 'text', type: 'string',},
  taskName: {title: '任务名称',order: 3,view: 'text', type: 'string',},
  approveResult: {title: '审批结果',order: 4,view: 'text', type: 'string',},
  approver: {title: '审批人',order: 5,view: 'text', type: 'string',},
};
